import type { FieldRule } from 'vant'

// 手机号校验规则
const mobileRule: FieldRule[] = [
  { required: true, message: '请输入手机号' },
  { pattern: /^1[3-8]\d{9}$/, message: '请输入合法手机号' }
]

// 密码校验规则
const passwordRule: FieldRule[] = [
  { required: true, message: '请输入密码' },
  { pattern: /^\w{8,24}$/, message: '密码需8-24位的字符' }
]

// 短信验证码校验规则
const codeRule: FieldRule[] = [
  { required: true, message: '请输入短信验证码' },
  { pattern: /^\d{6}$/, message: '请输入6位数字的短信验证码' }
]

export { mobileRule, passwordRule, codeRule }
